<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="format-detection" content="telephone=no,email=no,adress=no"/>
<title>先花花</title>
<link rel="stylesheet" type="text/css" href="css/common.css" />
<script type="text/javascript" src="script/jquery.js"></script>
<script type="text/javascript" src="script/column.js"></script>
<link href="css/home.css" rel="stylesheet" type="text/css" media="all" />
<link href="css/css.css" rel="stylesheet" type="text/css" media="all" />
<script type="text/javascript" src="script/jquery.js"></script>
<script type="text/javascript" src="script/jquery.cookie.js"></script>
</head>
<body>
<!--浮动-->
<div class="dropMask"></div>
<div class="dragBtn"></div>
<div class="dropBox">
  <div class="dropSkin"></div>
  <!-- 请求地址 -->
<ul class="dropList">
     <li class="nth-child_1"> <a href="index.html" class="dropIco"></a>
      <p>首页</p>
    </li>
    <li class="nth-child_2"> <a href="list.html" class="dropIco"></a>
      <p>投资</p>
    </li>
    <li class="nth-child_3"> <a href="user.html" class="dropIco"></a>
      <p>个人中心</p>
    </li>
    <li class="nth-child_4"> <a href="register.html" class="dropIco"></a>
      <p>注册</p>
    </li>
    <li class="nth-child_5"> <a href="login.html" class="dropIco"></a>
      <p>登录</p>
    </li>

  </ul>
</div>
<script src="script/index.js"></script>
<script src="script/jquery-ui.min.js"></script>

<!-- 页面头部 -->
<section>
  <div class="navigation-bar"> <a href="javascript:history.back(-1)" class="z-01"></a> <span>项目列表</span> <a href="index.html" class="z-02"></a> </div>
</section>
<!-- 中间内容 -->
<div class="main" style="background:#fff;">
  <div class="top">
  <div class="box">
        <a href="javascript:history.back(-1);" class="return"><img src="images/return.png"></a>
        借款
    </div>
</div>
<div class="login_lo" style="margin-top:56px;">
  <div class="box">
        <div class="lo_1 lo_2">
          <span>借多少</span>
            <input type="text" name="howMany" id="howMany" size="60" maxlength="60" style="color:#ccc"  placeholder="最低借1千 最高借10万，一千的整数倍">
        </div>
        <div class="lo_1 lo_2">
          <span>借多久</span>
              <table>
                  <tr>
                      <td>
                          <select name="howLong" class="ui-select" id="howLong">
                              <option value="0">请选择</option>
                              <option value="90">三个月</option>
                              <option value="180">六个月</option>
                              <option value="360">一年</option>
                          </select>
                          &nbsp;&nbsp;&nbsp;&nbsp; <abc>日利率万3(一千元用一天只需利息0.3)</abc>
                      </td>
                   </tr>
                </table>
        </div>
        <div class="lo_1 lo_2">
          <span>怎么还</span>
              <table>
                  <tr>
                      <td>
                          <select name="howStill" class="ui-select" id="howStill">
                              <option value="0">请选择</option>
                              <option value="1">等额本金</option>
                              <option value="2">等额本息</option>
                          </select>
                          &nbsp;&nbsp;&nbsp;&nbsp; <abc id="interest"></abc>
                      </td>
                   </tr>
                </table>
        </div>
        <div>
           <input type="button" class="lo_login" style="margin-bottom:50px" value="保存">
        </div>
    </div>
</div>
</div>
<!-- 页面底部 -->
<nav class="footer border_t" id="footer"> 
  <a href="index.html" class="" id="jx"><span></span>首页</a>
   <a href="list.html" id="lc" class=""><span></span>理财</a> 
  <a href="borrow_money.html" id="jk" class="nav_on"><span></span>借款</a>
   <a href="user.html" id="cf" class=""><span></span>我的账户</a> </nav>
</body>
</html>
<script type="text/javascript">
$(function(){
  storage=window.localStorage;
  uid = storage['userid'];
 $('.lo_login').click(function(){
  if(isNaN(uid)){
    alert("请先登录");
    window.location.href="login.html";
  }
  var howMany=$('#howMany').val();
  reg = /^\d+$/;
  if(howMany==''){
    alert('请输入借多少');
    return false;
  } 
  if(!reg.test(howMany)) 
  {
    alert('请输入整数')
    return false;
  }
  num = String(howMany/1000);  
  if(num.indexOf('.') > 0)
  {
    alert('请输入1000的整数倍')
    return false;
  }

  var howLong=$("#howLong option:selected").val();
  if(howLong=='请选择'){
    alert('请选择借多久');
    return false;
  }
  var howStill=$("#howStill option:selected").val();
  if(howStill=='请选择'){
    alert('请选择怎么还');
    return false;
  }
  $.ajax({
        url:'http://47.93.21.169/old/TP5/public/index.php/index/Borrow/index',
        type:'get',
        dataType:'jsonp',
        jsonp:"callback",
        data:{
          uid:uid,
          howMany:howMany,
          howLong:howLong,
          howStill:howStill
        },
        success:function(result){
          if(result.status==200){
            alert(result.msg);
            window.location.href="borrowhis.html";
          }else{
            alert(result.msg);
          }
        }
    });
 })
})
</script>




